package com.ymatou.iapi.livemanage.testcase;

import org.json.JSONObject;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.livemanage.service.GetSellerInfoCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.tag.P1;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.MapUtil;

public class Ts_GetSellerInfo {
	
	private static int sellerId = Integer.parseInt(EnvSetup.getData("productsellerid"));
	
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取买手信息");
	}

	@Before
	public void caseUp() {
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(new GetSellerInfoCall().getOpurl());
	}
	
	
	@After
	public void caseDown() {
		Logger.end();
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetSellerInfo_001() {
		Logger.start(true, "获取买手信息");
		try{
			
			JSONObject ret = new GetSellerInfoCall().callAndGetReturnData(MapUtil.hashMap("SellerId", sellerId));
			Logger.verifyEquals(200, ret.getInt("Code"), "报文返回码");
			Logger.verifyNotNull(ret.getJSONObject("Data"),"返回报文，数据不为空");
			Logger.verifyEquals(sellerId, ret.getJSONObject("Data").getInt("SellerId"), "SellerId 检查");
		}catch(Exception e){
			Logger.fail(e);
		}
	}
	
}
